<?php

namespace Lib;

class Profiler {

    private static $vars = array();

    public static function start($label) {
        self::$vars[$label]['start'] = microtime(TRUE);
    }

    public static function stop($label) {
        self::$vars[$label]['stop'] = microtime(TRUE);
    }

    public static function toString() {
        foreach (self::$vars as $key => $var) {
            echo "$key = " . number_format($var['stop'] - $var['start'], 3) . "<br>";
        }
    }

}

?>
